{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "斐波纳切数列：一个数列当前项等于前两项的和  \n",
    "\n",
    "质数和素数：除了1和它本身，不能被其他数整除  \n",
    "\n",
    "猴子吃桃：猴子吃桃的数目为当天桃子总数减1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Q2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = [1,2,3]\n",
    "b = [2]\n",
    "print(id(a))\n",
    "# method 1\n",
    "c = a+b\n",
    "# method 2\n",
    "a.append(b)\n",
    "print(id(a))\n",
    "# method 3\n",
    "a.extend(b)\n",
    "print(id(a))\n",
    "# method 4\n",
    "a.insert(len(a),b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Q3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def caculator(*args,**kwargs):\n",
    "    count = 0\n",
    "    if args:\n",
    "        for i in args:\n",
    "            count += i\n",
    "    if kwargs:\n",
    "        for i in kwargs.values():\n",
    "            count += i\n",
    "    print(count)\n",
    "caculator(3,4,a=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Q4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "b = \"continue\"\n",
    "while b == \"continue\":\n",
    "    a = input(\"please input +-*/\").strip()\n",
    "    num1 = int(input(\"plea input a num\").strip())\n",
    "    num2 = int(input(\"plea input a num\").strip())\n",
    "    if a == \"+\":\n",
    "        print(num1+num2)\n",
    "    if a == \"-\":\n",
    "        print(num1-num2)\n",
    "    if a == \"*\":\n",
    "        print(num1*num2)\n",
    "    if a == \"/\":\n",
    "        print(num1/num2)\n",
    "    b = input(\"continue or exit\")\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
